<!--
	URL/edit/:title/educations 
	app/views/educations/edit.html.erb
	The edit resume/educations view - form for editing an education instance for the resume of a user
	controller: educations, action: edit
-->			

<link rel="stylesheet" type="text/css" href="/stylesheets/resume_common.css" />
<link rel="stylesheet" type="text/css" href="/stylesheets/educations/edit.css" />

<div class="heading">
	<h3> Edit Education </h3>
	<div class="links">
		<%= link_to 'Add', '/new/'+@resume.title+'/educations' %>	
		<%= link_to 'Show', '/show/'+@resume.title+'/educations' %>
	</div>	
</div>

<% url = '/update/'+@resume.title+'/educations' %>
<% form_tag(url, :method => "post") do %> 
	
	<% if @educations.length!=0 %>
		<div class="tab_heading">
			<% @educations.each do |education| %>
			<span class="tab_item" id="tab_<%=h education.id %>">
				<%=h education.level %>
			</span>
			<% end %>		
		</div>
		<% @educations.each do |education| %>
		<table class="education_table" id="table_<%=h education.id %>" >
			<tr>
				<td class="column1">Level</td>
				<td class="column2">
					<input 	
						type	= "text" 
						class	= "level" 
						name	= "education[<%=h education.id %>][level]" 
						value	= "<%=h education.level %>" >	
				</td>	
			</tr>

			<tr>
				<td class="column1">Major</td>
				<td class="column2">
					<input 	
						type	= "text"
						class	= "major" 
						name	= "education[<%=h education.id %>][major]" 
						value	= "<%=h education.major %>" >	
				</td>
			</tr>

			<tr>
				<td class="column1">College</td>
				<td class="column2">
					<input 	
						type	= "text"
						class	= "college" 
						name	= "education[<%=h education.id %>][college]" 
						value	= "<%=h education.college %>" >	
				</td>
			</tr>

			<tr>
				<td class="column1">Score</td>
				<td class="column2">
					<input 	
						type	= "text" 
						class	= "score" 
						name	= "education[<%=h education.id %>][score]" 
						value	= "<%=h education.score %>" >
				</td>
			</tr>

			<tr>
				<td class="column1">more_info</td>
				<td class="column2">
					<textarea 
						class	= "more_info" 
						name	= "education[<%=h education.id %>][more_info]" 
						><%=h education.more_info %></textarea>		
				</td>			
			</tr>
		</table>		
		<% end # loop %>
		<table class="submit"><tr>
			<td class="column1"></td>
			<td class="column2">
				<input name="commit" type="submit" value="Update" />
			</td>
		</tr></table>	
	<% else %>
		<p> 
			No education data
			<%= link_to 'Add', '/new/'+@resume.title+'/educations' %>
		</p>
	<% end # if-else%>		
	
	
<% end # form_tag %>

<script type="text/javascript" src="/javascripts/jquery-1.3.2.js"></script>
<script type="text/javascript" src="/javascripts/resume_common.js"></script>
<script type="text/javascript" src="/javascripts/educations/edit.js"></script>